home *** CD-ROM | disk | FTP | other *** search
/ ftp.cs.arizona.edu / ftp.cs.arizona.edu.tar / ftp.cs.arizona.edu / icon / newsgrp / group97b.txt / 000095_icon-group-sender _Fri Oct 24 13:14:40 1997.msg < prev    next >
Internet Message Format  |  2000-09-20  |  4KB

  1. Return-Path: <icon-group-sender>
  2. Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239])
  3.     by cheltenham.cs.arizona.edu (8.8.7/8.8.7) with SMTP id NAA28882
  4.     for <icon-group-addresses@cheltenham.CS.Arizona.EDU>; Fri, 24 Oct 1997 13:14:39 -0700 (MST)
  5. Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM)
  6.     id AA24995; Fri, 24 Oct 1997 13:14:39 -0700
  7. From: gep2@computek.net
  8. Date: Fri, 24 Oct 1997 12:54:16 -0500
  9. Message-Id: <199710241754.MAA08555@axp.cmpu.net>
  10. Mime-Version: 1.0
  11. Content-Type: text/plain
  12. Content-Transfer-Encoding: 7bit
  13. Subject: Re: tabulating values
  14. To: icon-group@cs.arizona.edu
  15. X-Mailer: SPRY Mail Version: 04.00.06.17
  16. Errors-To: icon-group-errors@cs.arizona.edu
  17. Status: RO
  18.  
  19. > Well, I've now received six responses to my query, none of which provide a
  20. solution to the problem.  
  21.  
  22. Why are you asking those of us on the Net to do things for you which would 
  23. appear to be your homework assignments?
  24.  
  25. > I really do appreciate the responses, but four of the responses consisted of 
  26. people essentially saying "Heck, that's trivial" without proving it by actually 
  27. providing a working solution 
  28.  
  29. It's NOT as if something so evident requires a "proof".
  30.  
  31. > and the two responses that did actually contain code failed to provide a
  32. solution.  
  33.  
  34. OK, let me give you a SNOBOL4/SPITBOL version of your "solution":
  35.  
  36. -plusops 1                      ;* (for SNOBOL4+ only)
  37.            t = table()
  38. rdrec      line = input                          :f(donerd)
  39. tabnum     line span("0123456789") . n =         :f(rdrec)
  40.            t[+n] = t[+n] + 1                     :(tabnum)
  41. donerd     a = sort(t,1)                         :f(end)
  42.            output = "number   count"
  43. outlp      output = rpad(a[(i = i + 1),1],9) a[i,2]   :s(outlp)
  44. end
  45.  
  46. The FACT, Stuart, is that my original post holds true.  If you compare this 
  47. program against the word count program (which you will CERTAINLY find in the 
  48. Icon Program Library) you'll see that the technique used is essentially 
  49. identical, except that (1) one is spanning numeric characters instead of 
  50. alphabetic ones, and (2) the "+" used in front of the table index to make it 
  51. integer type rather than string type.  This program (or one nearly identical) is 
  52. probably an example program used in nearly every SNOBOL4/ICON book ever 
  53. published!!!
  54.  
  55. And with a fairly trivial upgrade to it it would also handle signed numbers and 
  56. decimal fractions, too.
  57.  
  58. But the bigger issue still remains:  why do you think we should be doing 
  59. homework assignments for you, and why do you feel that we have to "prove" 
  60. anything at all to you?  For you to even ASK here for such a trivial program is 
  61. to make it evident that you are unwilling (or unable) to pick up an Icon book 
  62. and READ it, or to give half a moment's effort to trying to learn how to use 
  63. this language.  And either case is sad, because the language really is far too 
  64. useful and interesting for you to devote such a pathetically poor effort to 
  65. learning to use and understand it.  (And besides, if you can't figure out the 
  66. beginning-level stuff like this, you're NEVER going to successfully finish your 
  67. later class assignments, anyhow, which will be complicated enough that you're 
  68. not going to find people here on the newsgroup who will post working-and-tested 
  69. solutions for you!).
  70.  
  71. Gordon Peterson
  72. http://www.computek.net/public/gep2/
  73. Support the Anti-SPAM Amendment!  Join at http://www.cauce.org/
  74.  
  75.